import java.util.Scanner;

public class Main1629 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = a / 100000;//123321-1
        int c = a / 10000 % 10;//123321-2
        int d = a / 1000 % 10;//123321-3
        int f = a / 1000 % 10;//123321-3
        int g = a / 10 % 10;//123321-2
        int h = a % 10;//123321-1
        if (b == h && c == g && d == f) {
            System.out.println("Y");
        } else {
            System.out.println("N");
        }
    }
}
